/*
 * SSAA.hpp
 *
 *  Created on: 2012/7/30
 *      Author: soniclin
 */

#ifndef SSAA_HPP
#define SSAA_HPP

#include "SSAA.h"

#include "../Box3D.h"
#include <vector>

typedef std::vector< std::vector< std::vector<sMathLib::Vector3> > > Grid3D;

typedef std::vector< std::vector< sMathLib::Vector3 > > Grid2D;

typedef std::vector< sMathLib::Vector3  > Grid1D;

namespace ibm
{

template<typename T>
class GridSuperSampling
{

public:

	void defineDomain(const sMathLib::VectorX<int, 3>& iPos)
	{
		domain.x0 = iPos[0] - 0.5;
		domain.x1 = iPos[0] + 0.5;
		domain.y0 = iPos[1] - 0.5;
		domain.y1 = iPos[1] + 0.5;
		domain.z0 = iPos[2] - 0.5;
		domain.z1 = iPos[2] + 0.5;
	}

	template<typename Container>
	void createSamples(const Sphere<T, ImmersedObject>& sphere, Container& samples, unsigned nSamples);

	T computeAverageValue()

protected:

	Box3D<T> domain;

};

template<>
template<>
double GridSuperSampling<double>::createSamples(const Sphere<double, ImmersedObject>& sphere, Grid3D& samples, unsigned nSamples)
{
	samples.assign(nSamples, Grid2D(nSamples, Grid1D(nSamples, sMathLib::Vector3())));
}

template<typename T, typename SamplingPolicy, typename Container>
SSAA<T, SamplingPolicy, COntainer>::SSAA(unsigned nSamples, Container& samples)
{
	// TODO Auto-generated constructor stub
	samples_data = &samples;

}

template<typename T, typename SamplingPolicy, typename Container>
SSAA<T, SamplingPolicy, COntainer>::SSAA(unsigned nSamples)
{

}

template<typename T, typename SamplingPolicy, typename Container>
T SSAA<T, SamplingPolicy, COntainer>::operator()(const sMathLib::VectorX<int, 3>& iPos, const Sphere<T, ImmersedObject>& sphere)
{

}

template<typename T, typename SamplingPolicy, typename Container>
SSAA<T, SamplingPolicy, COntainer>::~SSAA()
{
	// TODO Auto-generated destructor stub
}

}

#endif /* SSAA_HPP */
